package com.skyline.attraction.service;

import java.util.List;

import com.skyline.attraction.model.Attraction;
import com.skyline.attraction.model.AttractionRefrence;
import com.skyline.attraction.type.AttractionRefrenceType;
import com.skyline.common.bean.Page;
import com.skyline.user.model.User;
import com.skyline.wo.model.Album;
import com.skyline.wo.model.Article;

public interface AttractionRefrenceService {

	/**
	 * 插入refrence
	 * 
	 * @param refId
	 * @param refPortrait
	 *            type为Album是为相册封面，为Photo即为相片本身，其他有封面的为封面，不然就为空
	 * @param refTitle
	 *            refrence标题
	 * @param refDigest
	 * @param refType
	 *            ALBUM，PHOTO，ARTILE，TRAVLENOTE...
	 * @param attractionId
	 * @param attractionName
	 * @param attractionPortrait
	 * @param providerId
	 * @param providerNickname
	 * @param providerPortrait
	 * @param providerEmail
	 * @return
	 */
	public Long addRefrence(Long refId, String refPortrait, String refTitle, String refDigest,
			AttractionRefrenceType refType, Attraction attraction, User provider);

	/**
	 * 
	 * @param id
	 * @return
	 */
	public AttractionRefrence getRefrenceById(Long id);
	
	/**
	 * 
	 * @param id
	 * @return
	 */
	public AttractionRefrence getRefrenceForChange(Long id, Long adminId);
	
	public AttractionRefrence getRefrenceForChange(Long id, AttractionRefrenceType type, Long adminId);

	/**
	 * 根据Type获取，针对用户上传的photo需调用type为photo，返回图片
	 * 
	 * @param attractionId
	 * @param type
	 * @param page
	 * @return
	 */
	public List<AttractionRefrence> listRefrencesOfAttraction(Long attractionId, AttractionRefrenceType type, Page page);

	public void deleteRefrenceById(Long id, Long adminId);

	public void updateRefPortrait(Long id, String portrait);
	
	public boolean isRefrenceExist(Long attractionId, AttractionRefrenceType type, Long refId);
	
	public List<Article> queryArticlesWithRefed(Long ownerId, Long attractionId, Page page);
	
	public List<Album> queryAlbumsWithRefed(Long ownerId, Long attractionId, Page page);

	public List<AttractionRefrence> listSomeRefrencesOfAttraction(Long attractionId, AttractionRefrenceType type, Integer size);
}
